import numpy as np
import pylab as pl
from pylab import *
import matplotlib.pyplot as pyplot

data11 = np.loadtxt('fig1.dat')
fig1, axes = plt.subplots(nrows=1, ncols=1,figsize=(10,6))
pl.subplots_adjust(left=0.126, bottom=0.143, right=0.976, top=0.967, 
                   wspace=0.2, hspace=0)

rc('axes', linewidth=1)
pl.xlim(0, 0.09)
pl.ylim(-3.8, -1.4)
pl.xticks([0,0.04,0.08],['0.0','0.04','0.08'], fontsize =26)
pl.yticks([-3.8,-3.5,-3.0,-2.5,-2.0,-1.5],['','-3.5','-3.0','-2.5','-2.0','-1.5'], fontsize = 26)
pl.xlabel(r'$J/U$', fontsize=26, weight='bold',fontstyle='italic')
pl.ylabel(r'$E/U$', fontsize=26, weight='bold',fontstyle='italic')

ax = gca()

pl.plot(data11[:,0], data11[:,1], 'r-',linewidth=3.0,label = r'$E_{\rm CDW}/U$')
pl.plot(data11[:,0], data11[:,2], 'b-',linewidth=3.0,label = r'$E_{\rm SDW}/U$')

plt.legend(loc='upper left', frameon=False, fontsize = 22)
fig1.savefig('ener_compare.pdf')
pl.show()
